package StringBuffer

import (
	"fmt"
	"strings"
)

func Format(str string, replaces ...string) string {
	lists := strings.Split(str, "%s")
	fmt.Println(len(lists))
	ret := ""

	for index, value := range lists {
		if index+1 == len(lists) {
			break
		}
		ret += value + replaces[index]
	}

	return ret
}

func FormatSuperFast(str string, replaces ...string) string {
	for i := 0; i < len(replaces); i++ {
		str = strings.Replace(str, "%s", replaces[i], 1)
	}

	return str
}
